home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Development / Source / Connection Tool ƒ / Localization.c < prev    next >
C/C++ Source or Header  |  1994-02-19  |  2KB  |  47 lines

  1. // ===========================================================================
  2. // "Connection Tool Skeleton in C" for the Communications Toolbox
  3. // 
  4. //    Copyright © 1994 Peter J. Creath
  5. //    All Rights Reserved Worldwide
  6. // ===========================================================================
  7.  
  8. #include "ConnToolCommon.h"
  9.  
  10. // ===========================================================================
  11. // Function prototypes
  12. // ===========================================================================
  13. extern pascal long    main(ConnHandle hConn, short msg, Ptr pInput, Ptr *pOutput, long language);
  14. extern long    DoTranslate(Ptr inputStr, Ptr *outputStr, long fromLanguage, long toLanguage);
  15.  
  16. // ===========================================================================
  17. // main()
  18. //     This function is the entry point for the 'cloc' resource.  It passes control to the appropriate
  19. //     subroutines, depending on the incoming message.  This can probably remain unchanged.
  20. // ===========================================================================
  21.  
  22. pascal long main(ConnHandle hConn, short msg, Ptr pInput, Ptr *pOutput, long language)
  23. {
  24. long            rtnValue;
  25.  
  26.     switch (msg)
  27.         {
  28.             case cmL2English:
  29.                 rtnValue = DoTranslate(pInput, pOutput, language, verUS);
  30.                 break;
  31.             
  32.             case cmL2Intl:
  33.                 rtnValue = DoTranslate(pInput, pOutput, verUS, language);
  34.                 break;
  35.         }
  36. }
  37.  
  38. // ===========================================================================
  39. // DoTranslate()
  40. //    This function translates an input configuration string from one language to another.  It should
  41. //    return 0 if no problem, nonzero if there is a problem.  This routine needs to allocate outputStr.
  42. //    If the language requested is not supported, return 0 but leave outputStr = NIL.
  43. // ===========================================================================
  44. long    DoTranslate(Ptr inputStr, Ptr *outputStr, long fromLanguage, long toLanguage)
  45. {
  46.     // Whatever...
  47. }